﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/admincp.Master" AutoEventWireup="true"
    CodeBehind="DoiTac.aspx.cs" Inherits="VINETLIFE.AdminCP.DoiTac" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1 {
            text-align: right;
        }
    </style>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function OnClientPasteHtml(sender, args) {
            var commandName = args.get_commandName();
            var value = args.get_value();
            if (commandName == "ImageManager") {
                //See if an img has an alt tag set
                var div = document.createElement("DIV");
                //Do not use div.innerHTML as in IE this would cause the image's src or the link's href to be converted to absolute path.
                //This is a severe IE quirk.
                Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div, value);
                //Now check if there is alt attribute
                var img = div.firstChild;
                //alert(div.innerHTML);

                //Set new content to be pasted into the editor

                if (!!img.alt) {
                    var newInner = "<center>";
                    newInner = newInner + "<img src='" + img.src + "' alt='" + img.alt + "'/></center><center>";
                    newInner = newInner + img.alt + "</center>";

                    args.set_value(newInner);
                }
                else {
                    var newInner = "<center><img src='" + img.src + "' alt='Vinetlife.vn'/></center><br/>";

                    args.set_value(newInner);
                }

            }
        }
    </script>
</telerik:RadCodeBlock>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2 style="text-align: left;">Thêm mới / chỉnh sửa Business Partner
    </h2>
    <table class="tablet">
        <tr>
            <td style="width: 150px;">Mã đối tác
            </td>
            <td>
                <asp:TextBox ID="txtMaDoiTac" runat="server" Width="200px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                    ControlToValidate="txtMaDoiTac" Display="Dynamic" ErrorMessage="*"
                    ValidationGroup="luuLogo"></asp:RequiredFieldValidator>

            </td>

        </tr>
        <tr>
            <td>Tên đối tác
            </td>
            <td>
                <asp:TextBox ID="txtTenDoiTac" runat="server" Width="200px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="txtTenDoiTac" Display="Dynamic" ErrorMessage="*"
                    ValidationGroup="luuLogo"></asp:RequiredFieldValidator>
            </td>
            <td>Ảnh đại diện
            </td>
            <td>
                <asp:FileUpload ID="fulImage" runat="server" AutoPostBack="false" />
                <asp:HyperLink ID="hplImage" runat="server" TabIndex="11" Target="_blank"
                    Text="[Xem ảnh]" Visible="false"></asp:HyperLink>
            </td>
        </tr>
        <tr>
            <td>Địa chỉ
            </td>
            <td>
                <asp:TextBox ID="txtAddress" runat="server" Width="200px"></asp:TextBox>
            </td>
            <td>Điện thoại
            </td>
            <td>
                <asp:TextBox ID="txtDienThoai" runat="server" Width="200px"></asp:TextBox>
            </td>
        </tr>
        <tr>
        </tr>
        <tr>
            <td>Website
            </td>
            <td>
                <asp:TextBox ID="txtWebsite" runat="server" Width="200px"></asp:TextBox>
            </td>
            <td>Phân loại
            </td>
            <td>
                <asp:DropDownList runat="server" ID="ddlPartnerType" AppendDataBoundItems="true" DataValueField="PartnerTypeId" DataTextField="PartnerType">
                    <asp:ListItem Text=".: Phân loại :." Value="0"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>Giảm giá
            </td>
            <td>
                <asp:TextBox ID="txtGiamGia" runat="server" Width="50px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                    ControlToValidate="txtGiamGia" Display="Dynamic" ErrorMessage="*"
                    ValidationGroup="luuLogo"></asp:RequiredFieldValidator>
                <asp:RangeValidator ValidationGroup="luuLogo" runat="server" ID="rage" ControlToValidate="txtGiamGia" ForeColor="Red" Type="Integer" MinimumValue="0" MaximumValue="100"></asp:RangeValidator>
            </td>
            <td>Số thứ tự
            </td>
            <td>
                <asp:TextBox ID="txtOrder" runat="server" Width="50px" text="0"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                    ControlToValidate="txtOrder" Display="Dynamic" ErrorMessage="*"
                    ValidationGroup="luuLogo"></asp:RequiredFieldValidator>
                <asp:RangeValidator ValidationGroup="luuLogo" runat="server" ID="RangeValidator1" ControlToValidate="txtOrder" ForeColor="Red" Type="Integer" MinimumValue="0" MaximumValue="100"></asp:RangeValidator>
            </td>
        </tr>
        <tr>
            <td>Mô tả ngắn
            </td>   
            <td colspan="3">
                <telerik:RadEditor ID="txtDesciption" runat="server" OnClientPasteHtml="OnClientPasteHtml"
                    DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd" Width="99%" Height="300px">
                    <ImageManager MaxUploadFileSize="1024000000" ViewMode="Grid" DeletePaths="~/Media/"
                        UploadPaths="~/Media/" ViewPaths="~/Media/"></ImageManager>
                </telerik:RadEditor>
            </td>
        </tr>
        <tr>
            <td>Mô tả chi tiết
            </td>
            <td colspan="3">
                <telerik:RadEditor ID="txtDetail" runat="server" OnClientPasteHtml="OnClientPasteHtml"
                    DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd" Width="99%" Height="500px">
                    <ImageManager MaxUploadFileSize="1024000000" ViewMode="Grid" DeletePaths="~/Media/"
                        UploadPaths="~/Media/" ViewPaths="~/Media/"></ImageManager>
                </telerik:RadEditor>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="3">
                <asp:LinkButton ID="lbtLuu" runat="server" Text="Lưu lại" CssClass="button-gg-green"
                    OnClick="lbtLuu_Click" ValidationGroup="luuLogo" />&nbsp;&nbsp;
                <asp:LinkButton ID="lbtHuy0" runat="server" CausesValidation="False"
                    CssClass="button-gg-green" OnClick="lbtHuy_Click" Text="Hủy" />
            </td>
        </tr>
    </table>
</asp:Content>
